package com.cdqidi.core.weixinmanager.domain;

import com.cdqidi.util.page.BaseQuery;
import com.cdqidi.valid.group.DefaultGroup;
import com.cdqidi.valid.group.DeleteGroup;
import com.cdqidi.valid.group.UpdateGroup;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.time.LocalDateTime;

/**
 * 模板消息回执记录
 *
 * @author sjk
 */
@EqualsAndHashCode(callSuper = true)
@Getter
@Setter
public class TemplateMsgReportDTO extends BaseQuery {

    /**
     * 主键
     */
    @NotBlank(message = "日志ID不能为空", groups = {DeleteGroup.class, UpdateGroup.class})
    @Size(max = 50, message = "日志ID长度不能超过{max}位", groups = {DeleteGroup.class, UpdateGroup.class})
    private String logId;
    /**
     * 模板id
     */
    @NotBlank(message = "模板id不能为空", groups = DefaultGroup.class)
    @Size(max = 100, message = "模板id长度不能超过{max}位", groups = DefaultGroup.class)
    private String templateId;
    /**
     * 用户标识
     */
    @NotBlank(message = "用户标识不能为空", groups = DefaultGroup.class)
    @Size(max = 100, message = "用户标识长度不能超过{max}位", groups = DefaultGroup.class)
    private String openid;
    /**
     * 时间
     */
    private LocalDateTime reportTime;
    /**
     * 消息ID:调用微信接口发送消息的时候返回
     */
    @NotBlank(message = "消息ID:调用微信接口发送消息的时候返回不能为空", groups = DefaultGroup.class)
    @Size(max = 100, message = "消息ID:调用微信接口发送消息的时候返回长度不能超过{max}位", groups = DefaultGroup.class)
    private String msgId;
    /**
     * 状态码:0表示成功
     */
    @NotNull(message = "状态码不能为空", groups = DefaultGroup.class)
    private String errCode;
    /**
     * 错误消息
     */
    @Size(max = 200, message = "错误消息长度不能超过{max}位", groups = DefaultGroup.class)
    private String errMsg;

    @Override
    public void freeData() {
        this.logId = null;
        this.templateId = null;
        this.openid = null;
        this.reportTime = null;
        this.msgId = null;
        this.errCode = null;
        this.errMsg = null;
        super.freeData();
    }
}
